
a = 1
print(type(a))
b = bool(a)
print(b)
print(type(b))
#非0都是True
c = 2
print(type(c))
d = bool(c)
print(d)
print(type(d))

e = 0
print(type(e))
f = bool(e)
print(f)
print(type(f))

a1 = 1.0
print(type(a1))
b1 = bool(a1)
print(b1)
print(type(b1))

#字符串
#只要字符串中有内容，那么强制转换为bool就是True包括空格
a2 = '梦无涯'
print(type(a2))
b2 = bool(a2)
print(b2)
print(type(b2))

#列表
#只要列表中有内容，那么强制转换为bool就是True
a3 = ['高数','英语','C语言']
print(type(a3))
b3 = bool(a3)
print(b3)
print(type(b3))

#元组
#只要元组中有内容，那么强制转换为bool就是True
a4 = ('java','c++','python')
print(type(a4))
b4 = bool(a4)
print(b4)
print(type(b4))

#字典
#只要字典中有内容，那么强制转换为bool就是True
a5 = {'name':'梦无涯'}
print(type(a5))
b5 = bool(a5)
print(b5)
print(type(b5))

